package com.woniuxy.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.woniuxy.entity.Role;
import com.woniuxy.mapper.RoleMapper;
import com.woniuxy.service.RoleService;
@Service
public class RoleServiceImpl implements RoleService{
	@Autowired
 	private RoleMapper roleMapper;
	//查询所有角色信息
	@Override
	public List<Role> findAllRole() {
		return roleMapper.findAllRole();
	}
	//根据角色id查询权限id
	@Override
	public List<Integer> findPidByRid(int rid) {
		return roleMapper.findPidByRid(rid);
	}
	//根据权限id查询权限名称
	@Override
	public String findPnameByPid(int pid) {
		return roleMapper.findPnameByPid(pid);
	}
	//根据状态查询角色
	@Override
	public List<Role>findRoleByStatus(int status){
		return roleMapper.findRoleByStatus(status);
	}
	//根据关键字模糊查询
	@Override
	public List<Role>findRoleByWords(String words){
		return roleMapper.findRoleByWords(words);
	}
	//新增角色
	@Override
	public int insertRole(Role role) {
		return roleMapper.insertRole(role);
	}
	//删除
	@Override
	public int delByRid(int rid) {
		return roleMapper.delByRid(rid);
	}
	
}
